"""用户模型"""
from sqlalchemy import Column, String, Integer, Boolean
from .base import BaseModel


class User(BaseModel):
    """用户表模型"""
    __tablename__ = "users"
    
    username = Column(String(50), unique=True, index=True, nullable=False)
    password = Column(String(255), nullable=False)
    nickname = Column(String(50), nullable=True)
    avatar = Column(String(255), nullable=True)
    email = Column(String(100), unique=True, nullable=True)
    phone = Column(String(20), unique=True, nullable=True)
    bio = Column(String(255), nullable=True)
    is_admin = Column(Boolean, default=False)
    status = Column(Integer, default=1)
